<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>院系管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
     <!–[if IE]>
	<script src="__JS__/html5.js"></script>
    <![endif]–>
    <script type="text/javascript" src="__JS__/jshelper.js"></script> 
    <script type="text/JavaScript">
        function collegeedit(id){
            window.location.href="__URL__/collegeedit/id/"+id;
        }
        function collegedelete(id){
            if (confirm("你确定要删除吗")==true) {
                //posthelper([["id",id],],'__URL__/collegedelete');
                postwith('__URL__/collegedelete',{id:id});
            }
        }
        
        window.onload=show;
    </script>
    <script type="text/javascript" src="__JS__/jQuery/jquery.js"></script>
    <script type="text/javascript" src="__JS__/jQuery/jquery.form.js"></script>
    <script type="text/JavaScript">
    $(function(){
        $('#form1').ajaxForm({
            //beforeSubmit:  function(){alert("before");},  // pre-submit callback
            success:       complete,  // post-submit callback
            error:function(){alert("error");},
            dataType: 'json'
        });
        
        function complete(data){
            if (data.status==1)
            {
                window.location=window.location.href;
            }else{
                $('#result').html(data.info).show();
            }
        }
    });
    </script>
  </head>
  <body>	
		<!-- layout::Auth:header::0 -->
        	<div class="container-fluid">
     			<div class="row-fluid">
                	<!-- layout::Auth:leftmenu::0 -->
                    	<div class="span8">
                          <div class="hero-unit">
                            <h1>院系管理</h1>
                            <p style="font-size:12px">当前位置：
                            	<a href='__APP__/index/index' >主页</a>>
                                <a href='__URL__/index' >后台管理</a>>
                                <a href="__URL__/collegedetail" >院系管理</a>
                            </p>
                           </div>
						<div id='result'></div>	
						 <form id="form1" method="post" action="__URL__/collegeadd" class="well form-inline" >
                            <table class="table table-striped">
                                <thead style="background-color:#09F">
                                    <tr>
                                        <td style="text-align:right">
                                              <input type="text" name="name"class="input-xlarge" placeholder="院系名称">
                                              <input type="submit" class="btn btn-success" value="添加院系">
                                        </td>
                                    </tr>
                                </thead>
                            </table>
                            <hr>
                            <load href"__PUBLIC__/js/list_show.js">
                            <table class="table table-bordered table-striped">
                            	<thead style="background-color:#09F">
                                	<tr>
                                    	<th style="display:none">
                                        	院系ID
                                        </th>
                                    	<th style="width:50%">
                                        	院系名称
                                        </th>
                                        <th style="width:50%">
                                        	操作
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                                	<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><tr>
                                        	<td style="display:none"><?php echo ($vo["id"]); ?></td>
                                            <td><?php echo ($vo["name"]); ?></td>
                                            <td>
                                            	<a href="javascript:collegeedit('<?php echo ($vo["id"]); ?>')" class="btn btn-primary">编辑</a>
                                                <a  href="javascript:collegedelete('<?php echo ($vo["id"]); ?>')" class="btn btn-danger">删除</a>
                                            </td>
                                        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                </tbody>
                            </table>
                            <p class="navbar-text pull-right"><?php echo ($page); ?></p>
                         </form>
					</div>
                  </div>
                </div>
                <script src="__JS__/placeholderIEshow.js"></script>
	</body>
</html>